package com.sky.controller.user;

import com.sky.result.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@RestController("userShopController")
@RequestMapping("/user/shop")
@Slf4j
@Api("用户店铺操作")
public class ShopController {
    @Resource
    RedisTemplate<String,Object> redisTemplate;

    @GetMapping ("/status")
    @ApiOperation("获取店铺状态")
    public Result getStatus(){
        log.info("获取店铺状态");
        Integer shopStatus = (Integer)redisTemplate.opsForValue().get("SHOP_STATUS");
        return Result.success(shopStatus);
    }
}
